<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/2/14
 * Time: 20:36
 */
class CacheConf
{
    public static $keys = array(
        'count_weight' => array(
            'hash_pre' => 'H:tcw:',
            'sset_pre' => 'SSet:tcw:list',
            'expire'   => 0
        ),
        'article'      => array(
            'hash_pre' => 'H:atc:',
            'sset_pre' => 'SSet:atc:list',
            'expire'   => 2592000
        ),
    );

    public static  function getCacheKeyDetail($module, $type = '', $key)
    {
        $hash_pre = CacheConf::$keys[$module]['hash_pre'];
        $sset_pre = CacheConf::$keys[$module]['sset_pre'];
        $expire   = CacheConf::$keys[$module]['expire'];

        $keys = array(
            'hash'   => $hash_pre.$key,
            'sset'   => $sset_pre,
            'expire' => $expire
        );
        if (isset($keys[$type])) return $keys[$type];

        return $keys;
    }
}